<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <title>吊装租赁管理系统</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css">
    <link href="bootstrap-treeview/bootstrap-treeview.min.css" rel="stylesheet">
    <link href="css/navpage.css" rel="stylesheet">
    <style>
        body{
            width: 100%;
        }
        #bannerFirst{
            border-bottom: #ced4da 1px solid;
            background-image:url(images/indexbanner.png);
            background-size: 100% 100%;
            -moz-background-size: 100% 100%;
        }

    </style>
</head>
<body>
<div class="container-fluid">
    <!-- Stack the columns on mobile by making one full-width and the other half-width -->
    <div class="row" id="bannerFirst" style="height: 180px">
        <div class="col-xl-8 col-sm-8 col-xl-8"  >
            <img src="../../images/logo.png" width="80" height="60">
        </div>
        <div class="col-8 col-xl-4 col-sm-4 col-xl-4">
                <div class="col-2" style="top: 143px; left: 80px">
                    <img src="images/userlogo.png" width="25px" height="25px" >

                </div>
            <div class="dropdown offset-2" style="top:110px;left: 60px">
                <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >

                </button>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" href="/userInfo">个人中心</a>
                    <a class="dropdown-item" href="/logout">退出</a>
                </div>
            </div>
            </div>
        </div>
    <!--下面的-->
    <div class="row">
        <div class="col-md-12" style="margin-top: 20px">
            <div class="row">
                <div class="col-lg-3 col-sm-3 col-xl-3">
                    <div id="mytreeview" class="">
                    </div>
                </div>
                <div class="col-lg-9 col-sm-9 col-xl-9">
                    <div class="row">
                        <nav aria-label="breadcrumb" style="width: 950px">
                            <ol class="breadcrumb" id="breadcrumb">
                                <li class="breadcrumb-item"><a href="#">首页</a></li>
                                <li class="breadcrumb-item"><a href="#">基本信息</a></li>
                                <li class="breadcrumb-item active" aria-current="page">公司信息</li>
                            </ol>
                        </nav>
                    </div>
                    <div class="row embed-responsive embed-responsive-16by9" >
                        <iframe class="embed-responsive-item"  id="myiframe" src="/pages/baseInfo/company.html"></iframe>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="jquery/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/popper.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap-treeview/bootstrap-treeview.min.js"></script>

<script>
    $(document).ready(function () {
        getUserInfo();
        function  getUserInfo() {
            $.ajax({
                url:"user/getUserInfo",
                type:"post",
                dataType:"json",
                success:function(result){
                    $("#dropdownMenuButton").text(result.object.r_name+':'+result.object.loginAcct)
                }
            })
        }
       $.getJSON("json/menu_json.json",function (data) {
           $("#mytreeview").treeview({
               data: data,
               ShowExpandCollapse:true,
               collapseIcon:"",
               expandIcon:"",
               selectedBackColor: "#808B96",
               highlightSelected: true,
               onNodeSelected:function(event,data) {
                   console.log(data);
                   var parent = $("#mytreeview").treeview("getNode",data.parentId);
                   console.log(parent);
                   $("#breadcrumb").html('<li class="breadcrumb-item"><a href="#">首页</a></li>\n' +
                       '                                <li class="breadcrumb-item"><a href="#">'+parent.text+'</a></li>\n' +
                       '                                <li class="breadcrumb-item active" aria-current="page" href="/pages/baseInfo/company.html">'+data.text+'</li>')
                   $("#myiframe").attr("src",data.href);
               }

           });

       })
    });
</script>
</body>
</html>